// 引用
import Vue from 'vue'
import VueRouter from 'vue-router'
// 使用bus

import Main from '@/views/Layout.vue'
// 注册，
Vue.use(VueRouter)


const routes = [
  {
    path: '/',
    name: 'Home',   
    component: Main,
    redirect: '/home/featured',  
    children: [
      { path: 'home', name: 'index', component: () => import('@/views/home/Home') },
      { path: 'users', name: 'users', component: () => import('@/views/user/User') },
      { path: 'news', name: 'news', component: () => import('@/views/news/News') },
      { path: 'shop', name: 'shop', component: () => import('@/views/shop/Shop') },     
    ]
  }, 
  // 首页
  {
    path: '/home',
    component: () => import('@/views/home/Home'),
    redirect:'/home/featured',
    children: [
      { path: 'attention', name: 'attention', component: () => import('@/views/home/Attention') }, 
      { path: 'featured', name: 'featured', component: () => import('@/views/home/Featured') }, 
      { path: 'round', name: 'round', component: () => import('@/views/home/Round') }, 
    ]
  },
  {
    path: '/node',
    name:'node',
    component:()=>import('@/views/home/node/Node'),
  },
  // 商城搜
 {path:'/searchgoods',name:'searchgoods',component:()=>import('@/views/shop/Searchgoods')}
   
  
  
]

const router = new VueRouter({
 
  routes
})

export default router
